package com.pj.android.brower.ui

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import com.pj.android.brower.widget.LoadingDialog
import com.umeng.message.PushAgent

open class BaseActivity : AppCompatActivity() {
    private lateinit var processDialog: LoadingDialog

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        PushAgent.getInstance(this).onAppStart()

        initView()

    }

    private fun initView() {
        processDialog = LoadingDialog()
        processDialog.init(this)
    }

    fun showProcess(msg: String = "Loading...") {
        processDialog.showLoading(msg)
    }

    fun closeProcess() {
        if (!this.isFinishing && !this.isDestroyed) {
            processDialog.closeProgress()
        }
    }
}
